stiko commented Jun 28, 2018 |
---|
To reproduce, simply run:<br>$docker run -d php:7.2-apache<br>$docker exec -ti <container_id> bash<br>$apache2 -t<br> Result: apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot If you source /etc/apache2/envvars then restart apache, the container stops. Starting it will repeat the cycle. Any one has a solution to this? |
The php:apache
images actually use apache-foreground
to load the apache envvars
file; and not apache2
directly (or apache2ctl
since that would require an init system in the container).
Next time, look at the Dockerfile of the image to see what command and entrypoint it runs by default:
You can find links to all the Dockerfiles for all versions of official images on their respective Docker Hub descriptions (and in this repo).